﻿@using Equation.Enterprise.Framework.Web.Model
@using ENail.Portal.Web.Models
@using MvcContrib.UI.Pager
@using MvcContrib.UI.Grid 
@using MvcContrib.Pagination
@model GenericListViewModel<ENail.Portal.Web.Models.TaskListViewItem>

<div style="background-color:#edd2ca;width:150px;height:15px;text-align:center;padding:5px"> <font style="color:#5b362c;font-weight:bold">Tasks</font> </div>
<table width="150">
    @*    <tr style="background-color:burlywood">
        <th style="text-align:center">
            MADE
        </th>
        <th style="text-align:center">
            WAITING
        </th>
    </tr>
*@    
@{
    string name="";

    foreach (var item in Model.List)
    {
        if (item.Made==0 && item.Waiting==0) {continue;}
        if (name != item.FirstName + item.LastName)
        {
            name = item.FirstName + item.LastName;

            <tr style="background-color: bisque">
                <td colspan="2" style="text-align: left">
                    @Html.DisplayFor(modelItem => item.FirstName) &nbsp; @Html.DisplayFor(modelItem => item.LastName)
                </td>
            </tr>
        }
        <tr style="background-color: burlywood">
            <td colspan="2" style="text-align: left ">
                @Html.DisplayFor(modelItem => item.Service)
            </td>
        </tr>
        <tr style="background-color: azure; text-align: center">
            <td style="color: chocolate">Waiting:
                @Html.DisplayFor(modelItem => item.Waiting)
            </td>
            <td style="color: blue"> Made:
                @Html.DisplayFor(modelItem => item.Made)
            </td>
        </tr>
    }
}

@*                @Html.Grid(Model.List).Columns((column) =>
                                                {
                                                    column.For(x => x.FirstName)
                                                            .Named("First Name")
                                                            .Attributes(width => "50px");
                                                    column.For(x => x.LastName)
                                                            .Named("Last Name")
                                                            .Attributes(width => "50px");
                                                    column.For(x => x.Made)
                                                            .Named("Made")
                                                            .Attributes(width => "30px");
                                                    column.For(x => x.Waiting)
                                                            .Named("Waiting")
                                                            .Attributes(width => "30px");
                                                    
                                                }
                                        ).Attributes(@class => "grid"
                                        ).HeaderRowAttributes(new Dictionary<string, object> { { "class", "gridheaderrow" } }
                                        ).RowAttributes(row => new Dictionary<string, object> { { "onclick", "document.location='" + Url.Action("Update", new { Id = row.Item.Id }) + "'"} })
*@
</table>
